  <?
include "include/database.php";
  
   ?> 
    
    <table width="500" border="0">
		<tr>
			<td width="5%"><b>Nr</b></td>
			<td width="50%"><b>Omschrijving</b></td>
			<td width="15%"><b>Bedrag</b></td>
            <td width="7%"><b>Info</b></td>
		</tr>
		<tr>
			<td colspan="5"><hr size="1" width="100%"></td>
		</tr>
		<?
		
		$id = $_GET['sub'];
		$query = mysql_query("SELECT * FROM artikelen WHERE subarticleid = '". $id . "'"); 
		while($result = mysql_fetch_array($query))
		{
		?>
		<tr>
			<td><? print $result['id']; ?></a></td>
			<td><? print $result['omschrijving']; ?></td>
			<td>&euro;<? print $result['bedrag']; ?></td>
			<td><a href="index.php?page=article&id=<? print $result['id']; ?>"> details </a></td>
            <td><?  $qry = mysql_query("SELECT * FROM sessie WHERE ip = '".$_SERVER['REMOTE_ADDR']."'");
					if(mysql_num_rows($qry)>0)
					{
					?>
				<a href="index.php?page=winkelwagen&action=add&aantal=1&id=<? print $result['id']; ?>">
				<img src="images/winkelwagen.gif" border="0"></a>
                <? } ?>
			</td>
		</tr>
        
		<?
		}
		$result = mysql_num_rows($query);  
		if(!$result)
		{
		?>
		<tr>
			<td colspan="5">Geen artikelen in deze subartikel.</td>
		</tr>
		<?
		}
		?>
	</table>